package com.example.permission.controller;

import com.example.permission.model.req.PermissionDTO;
import com.example.permission.model.resp.PermissionVO;
import com.example.permission.service.PermissionService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author qwer3
 * @version 1.0.0
 * @create 2025/11/1 22:16
 */
@RestController
@RequestMapping("/api/sys/permission")
@RequiredArgsConstructor
public class PermissionController {
    private final PermissionService permissionService;

    @PostMapping("/list")
    public List<PermissionVO> getSystemPermission(@RequestBody PermissionDTO permissionDTO) {
        return permissionService.getSystemPermission(permissionDTO.getSystem());
    }
}